﻿using crm_data;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace crm_server
{
    public interface ICustomerService
    {
        /// <summary>
        /// 获取实体集合
        /// </summary>
        /// <returns></returns>
        List<Customer> GetAllList();

        ///// <summary>
        ///// 根据lambda表达式条件获取实体集合
        ///// </summary>
        ///// <param name="predicate">lambda表达式条件</param>
        ///// <returns></returns>
        //List<TEntity> GetAllList(Expression<Func<TEntity, bool>> predicate);

        List<Customer> GetListPage(string customerName, string[] order, int startPage, int pageSize, out int rowCount);

        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="id">实体主键</param>
        /// <returns></returns>
        Customer Get(Guid id);

        ///// <summary>
        ///// 根据lambda表达式条件获取单个实体
        ///// </summary>
        ///// <param name="predicate">lambda表达式条件</param>
        ///// <returns></returns>
        //TEntity FirstOrDefault(Expression<Func<TEntity, bool>> predicate);

        /// <summary>
        /// 新增实体
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        bool Insert(Customer entity);

        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="entity">实体</param>
        bool Update(Customer entity);

        ///// <summary>
        ///// 新增或更新实体
        ///// </summary>
        ///// <param name="entity">实体</param>
        //TEntity InsertOrUpdate(TEntity entity);

        ///// <summary>
        ///// 删除实体
        ///// </summary>
        ///// <param name="entity">要删除的实体</param>
        //void Delete(TEntity entity);

        ///// <summary>
        ///// 删除实体
        ///// </summary>
        ///// <param name="id">实体主键</param>
        //void Delete(TPrimaryKey id);
    }
}
